# coding=utf-8
s = 'abcdbcde'

sub = ''.join([s[i] if s[i] not in s[i+1:] else '' for i in range(len(s))])
print sub

print len(s)//2
s1 = set(s[:len(s)//2])
s2 = set(s[len(s)//2:])

print s[:len(s)//2]
print s[len(s)//2:]
print s1
print s2

print (s1 - s2)
print (s2 - s1)
print s1 & s2
